<#assign filePath>${project.projectName}/${project.projectName}-biz/src/main/java/${project.basePackage?replace(".","/")}/${model.moduleName?replace(".","/")}/service/</#assign>
<#assign fileName>${model.name?cap_first}Service.java</#assign>
package ${project.basePackage}.${module.moduleName}.service;

<#list model.fieldList as field>
    <#if model.primaryFieldId?? && model.primaryFieldId == field.id >
        <#assign primaryField= field>
    </#if>
</#list>
<#assign importPkgs=[project.basePackage+'.'+module.moduleName+'.model.'+model.name?cap_first]>
<#list model.methodList as method>
    <#if method.type == "CREATE_CMD">
        <#assign hasCmd= true>
        <#assign importPkgs=importPkgs+[project.basePackage+'.'+module.moduleName+'.model.'+model.name?cap_first+method.name?cap_first+'Cmd']>
        <#if !importPkgs?seq_contains('jakarta.validation.Valid')>
            <#assign importPkgs=importPkgs+['jakarta.validation.Valid']>
        </#if>
    </#if>
    <#if method.type == "MODIFY_CMD" && primaryField??>
        <#assign hasCmd= true>
        <#assign importPkgs=importPkgs+[project.basePackage+'.'+module.moduleName+'.model.'+model.name?cap_first+method.name?cap_first+'Cmd']>
        <#if !importPkgs?seq_contains('jakarta.validation.Valid')>
            <#assign importPkgs=importPkgs+['jakarta.validation.Valid']>
        </#if>
    </#if>
    <#if method.type == "REMOVE_CMD" && primaryField??>
        <#assign hasCmd= true>
        <#assign importPkgs=importPkgs+['com.fa4j.common.base.model.RemoveCmd']>
        <#if !importPkgs?seq_contains('jakarta.validation.Valid')>
            <#assign importPkgs=importPkgs+['jakarta.validation.Valid']>
        </#if>
    </#if>
</#list>
<#if !(hasCmd??) ><#stop></#if>
<#list importPkgs?filter(p->!p?starts_with("java.lang"))?sort as pkg>
import ${pkg};
</#list>

/**
 * 服务接口-${model.remark}
 *
 * @since ${.now?string("yyyy-MM-dd HH:mm:ss")}
 */
public interface ${model.name?cap_first}Service {
    <#list model.methodList as method>
        <#if method.type == "CREATE_CMD">
    /**
     * ${model.remark}-${method.remark}
     *
     * @param cmd ${method.remark}参数
     * @return ${model.remark}
     */
    ${model.name?cap_first} ${method.name}(@Valid ${model.name?cap_first}${method.name?cap_first}Cmd cmd);
        </#if>
        <#if method.type == "MODIFY_CMD" && primaryField??>
    /**
     * ${model.remark}-${method.remark}
     *
     * @param cmd ${method.remark}参数
     * @return ${model.remark}
     */
    ${model.name?cap_first} ${method.name}(@Valid ${model.name?cap_first}${method.name?cap_first}Cmd cmd);
        </#if>
        <#if method.type == "REMOVE_CMD" && primaryField??>
    /**
     * ${model.remark}-${method.remark}
     *
     * @param cmd ${method.remark}参数
     * @return ${model.remark}
     */
    ${model.name?cap_first} ${method.name}(@Valid RemoveCmd<${primaryField.type.type.simpleName}> cmd);
        </#if>

    </#list>
}

